package com.qingfeng.medical.biz.information.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qingfeng.medical.base.domain.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.Map;

/**
 * 数据字典表
 *
 * @author 清风学Java
 * @date 2023-04-08 23:43:31
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "数据字典表")
@TableName("dict")
public class Dict extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "上级id")
	private Long parentId;

	@ApiModelProperty(value = "名称")
	private String dictName;

	@ApiModelProperty(value = "值")
	private String dictValue;

	@ApiModelProperty(value = "编码")
	private String dictCode;

	/**
	 * 做表层级显示的一个字段，因为表中没有，所以要将其排除掉
	 */
	@ApiModelProperty(value = "是否包含子节点")
	@TableField(exist = false)
	private boolean hasChildren;

	@Builder
	public Dict(Long id, Date createTime, Date updateTime, Map<String, Object> param,
				Long parentId, String dictName,
				String dictValue, String dictCode) {
		super(id, createTime, updateTime, param);
		this.parentId = parentId;
		this.dictName = dictName;
		this.dictValue = dictValue;
		this.dictCode = dictCode;
	}
}
